/***********************************************************************
 * Module:  CustomerCare.java
 * Author:  ZhangYQ
 * Purpose: Defines the Class CustomerCare
 ***********************************************************************/
package office.bo.sale.impl;

import java.util.Date;

import current.security.user.domain.User;

import office.bo.sale.ICustomerCare;
import office.domainset.BizDomainProviderSetImpl;
import platform.common.bo.PersistenceBO;
import platform.common.dao.IDomainProviderSet;
import platform.common.exception.BusinessException;
/**
 * 客户关怀
 * @author ZhangYQ
 *
 */
public class CustomerCare extends PersistenceBO implements ICustomerCare {
	private static final long serialVersionUID = 1L;
	private String title;   //标题
	private Date careTime;  //关怀时间
	private String principal;//当前负责人
	private String principalName;//当前负责人
	private String content; //内容
	private String mark;
	private String customerId;  //对应的客户
	private String customerName;//客户名称
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getCareTime() {
		return careTime;
	}

	public void setCareTime(Date careTime) {
		this.careTime = careTime;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public String getPrincipal() {
		return principal;
	}

	public void setPrincipal(String principal) {
		this.principal = principal;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getMark() {
		return mark;
	}

	public void setMark(String mark) {
		this.mark = mark;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	/**
	 * 获取客户
	 * @param domainProviderSet
	 * @return
	 * @throws BusinessException
	 */
	public Customer getCustomer(IDomainProviderSet domainProviderSet) throws BusinessException{
		Customer customer=null;
		try {
			BizDomainProviderSetImpl domainProviderSetImpl = (BizDomainProviderSetImpl) domainProviderSet;
			customer=(Customer)domainProviderSetImpl.getDao().findByIdAndDomain(domainProviderSetImpl.getCustomerDP(), this.getCustomerId());
		} catch (Exception e) {
			throw this.handleBusinessBOException(e);
		}
		return customer;
	}
	/**
	 * 获取当前负责人
	 * @param domainProviderSet
	 * @return
	 * @throws BusinessException
	 */
	public User getUser(IDomainProviderSet domainProviderSet) throws BusinessException{
		User user=null;
		try {
			BizDomainProviderSetImpl domainProviderSetImpl = (BizDomainProviderSetImpl) domainProviderSet;
			user=(User)domainProviderSetImpl.getDao().findByIdAndDomain(domainProviderSetImpl.getUserDP(), this.getPrincipal());
		} catch (Exception e) {
			throw this.handleBusinessBOException(e);
		}
		return user;
	}
	
	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getPrincipalName() {
		return principalName;
	}

	public void setPrincipalName(String principalName) {
		this.principalName = principalName;
	}
	
	
}